// 导出路由映射
(function (module) {
    module.exports = {
        map: function (router) {
            router.map({
                '/': {
                    name: 'login',
                    component: function (resolve) {
                        require(['./viewModels/login.vue'], resolve)
                    }
                },
                /* 404路由 */
                '*': {
                    component: function(resolve){
                        require(['./viewModels/login.vue'],resolve);
                    }
                },
                '/wap/:code': {
                    name: 'wap',
                    component: function (resolve) {
                        require(['./viewModels/wap.vue'], resolve)
                    }
                },
                '/index': {
                    name: 'index',
                    component: function (resolve) {
                        require(['./viewModels/index.vue'], resolve)
                    },
                    subRoutes: {
                        '/': {
                            name: 'systemHome',
                            component: function (resolve) {
                                // '系统主页'
                                require(['./viewModels/systemHome.vue'], resolve)
                            }
                        },
                        '/allCompany': {
                            name: 'allCompany',
                            component: function (resolve) {
                                // '公司列表'
                                require(['./viewModels/allCompany.vue'], resolve)
                            }
                        },
                        '/companyInfo': {
                            name: 'companyInfo',
                            component: function (resolve) {
                                // '公司详情2'
                                require(['./viewModels/companyInfo.vue'], resolve)
                            }
                        },
                        '/companyInfo/:id': {
                            name: 'companyInfo',
                            component: function (resolve) {
                                // '公司详情'
                                require(['./viewModels/companyInfo.vue'], resolve)
                            }
                        },
                        '/addCompany': {
                            name: 'addCompany',
                            component: function (resolve) {
                                // '录入信息'
                                require(['./viewModels/addCompany.vue'], resolve)
                            }
                        },
                        '/addCompany/:id': {
                            name: 'addCompany',
                            component: function (resolve) {
                                // '录入信息'
                                require(['./viewModels/addCompany.vue'], resolve)
                            }
                        },
                        '/allAariety': {
                            name: 'allAariety',
                            component: function (resolve) {
                                // '品种列表'
                                require(['./viewModels/allAariety.vue'], resolve)
                            }
                        },
                        '/codeHistory': {
                            name: 'codeHistory',
                            component: function (resolve) {
                                // '生成历史'
                                require(['./viewModels/codeHistory.vue'], resolve)
                            }
                        },
                        '/codeHistory/:company_id': {
                            name: 'codeHistory',
                            component: function (resolve) {
                                // '生成历史'
                                require(['./viewModels/codeHistory.vue'], resolve)
                            }
                        },
                        '/codeManage': {
                            name: 'codeManage',
                            component: function (resolve) {
                                // '查询管理'
                                require(['./viewModels/codeManage.vue'], resolve)
                            }
                        },
                        '/codedetail/:pino' : {
                            name: 'codedetail',
                            component: function (resolve) {
                                // '批次详细'
                                require(['./viewModels/codedetail.vue'], resolve)
                            }
                        },
                        '/profile': {
                            name: 'profile',
                            component: function (resolve) {
                                // '个人信息'
                                require(['./viewModels/profile.vue'], resolve)
                            }
                        },
                        '/editProfile': {
                            name: 'editProfile',
                            component: function (resolve) {
                                // '编辑信息'
                                require(['./viewModels/editProfile.vue'], resolve)
                            }
                        },
                        '/listProfile': {
                            name: 'listProfile',
                            component: function (resolve) {
                                // '列表管理'
                                require(['./viewModels/listProfile.vue'], resolve)
                            }
                        }
                    }
                }
            });
        }
    };
    return module.exports;
}(module));